package cn.dakaqi.entities;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/18.
 * 活动招募
 */
@Cacheable
@Entity
@Table(name = "U_ACTIVITY_RECRUIT")
public class ActivityRecruit extends IdEntity
{
    private Activity activity;  //活动
    private int needs;//需要人数
    private String job;//职业
    private String skill;//服务技能
    private String serviceField;//服务领域
    private String img;//封面图
    private Date createTime;//发布时间
    private Date stopTime;//招募结束日期
    private int top;//是否被置顶
    private int applys;//报名人数
    private String question;//问题列表
    private int status; //招募状态
    private int browses;//浏览量

    public int getBrowses()
    {
        return browses;
    }

    public void setBrowses(int browses)
    {
        this.browses = browses;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getStopTime()
    {
        return stopTime;
    }

    public void setStopTime(Date stopTime)
    {
        this.stopTime = stopTime;
    }

    public String getQuestion()
    {
        return question;
    }

    public void setQuestion(String question)
    {
        this.question = question;
    }

    public int getTop()
    {
        return top;
    }

    public void setTop(int top)
    {
        this.top = top;
    }

    public int getApplys()
    {
        return applys;
    }

    public void setApplys(int applys)
    {
        this.applys = applys;
    }

    @OneToOne
    @JoinColumn(name = "ACTIVITY_ID")
    @JsonIgnore
    public Activity getActivity()
    {
        return activity;
    }

    public void setActivity(Activity activity)
    {
        this.activity = activity;
    }

    public int getNeeds()
    {
        return needs;
    }

    public void setNeeds(int needs)
    {
        this.needs = needs;
    }

    public String getJob()
    {
        return job;
    }

    public void setJob(String job)
    {
        this.job = job;
    }

    public String getSkill()
    {
        return skill;
    }

    public void setSkill(String skill)
    {
        this.skill = skill;
    }

    public String getServiceField()
    {
        return serviceField;
    }

    public void setServiceField(String serviceField)
    {
        this.serviceField = serviceField;
    }

    public String getImg()
    {
        return img;
    }

    public void setImg(String img)
    {
        this.img = img;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    //    @Override
//    public String toString() {
//        return ToStringBuilder.reflectionToString(this);
//    }
}
